<?php 
/**
 * 首页图片的控制器
 * @author Administrator
 *
 */
class SyimgAction extends BaseAction
{
	public function index()
	{
		$id = htmlspecialchars($_GET['id'], ENT_QUOTES);
		//die(P($id));	
		//首页model
		$SyimgModel = new SyimgModel();
		
		//获取内容
		$result = $SyimgModel->getCardById($id);

		//die(P($result));
		$this->id = $_GET['id'];
		
		$this->result = $result;
		
		$this->display();
	}
	

	
	/**
	 * 更新首页图片模板
	 */
	public function doCardUpdate()
	{
			
		$requestArr = common_html_Arr($_POST);
		//die(P($requestArr));	

		//首页图片model
		$SyimgModel = new SyimgModel();
		//die(P($requestArr));
		if ( $SyimgModel->updateCard($requestArr, $requestArr['id']) !== false )
		{
			$response['status'] = 1;
	
			$response['info'] = '更新成功';
		}
		else
		{
			$response['status'] = 0;
	
			$response['info'] = '更新失败';
		}
			
		die(json_encode($response));
			
	}
	
}


 ?>